package com.lanou.musicproject.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lanou.musicproject.R;


/**
 * Created by lidong on 15/10/20.
 * 音乐馆fragment
 */
public class MusicFragment extends Fragment {
    private FragmentManager manager;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View musicView = inflater.inflate(R.layout.fragment_music, null);
        initView();
        return musicView;
    }

    /**
     * 加载布局
     */
    private void initView() {
        manager = getActivity().getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.replace(R.id.left_view, new LeftFragment(),"left");
        transaction.replace(R.id.right_view, new RightFragment(),"right");
        transaction.commit();
    }
}
